var startDate = new Date();
var _tsDiff = _serverTS - startDate.getTime();
var meseci = ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'];

function showTime()
{
    clockDiv = document.getElementById('serverClock');
    if (clockDiv)
    {
        clockDiv.innerHTML = getTimeStr(true);
        setTimeout('showTime()', 5000);
    }
}


function getTimeStr() {
    return getTimeStr(false);
}

function getTimeStr(blink)
{
    var date = new Date();
    var currTS  = date.getTime() + _tsDiff;

    var serverDate = new Date(currTS);
    day = serverDate.getDate();
    mon = serverDate.getMonth();
    yr  = serverDate.getFullYear();
    hr  = serverDate.getHours();
    min = serverDate.getMinutes();

    if (10 > hr)
        hr = '0' + hr;
    if (10 > min)
        min = '0' + min;
    var collon = blink ? '<span style="text-decoration:blink">:</span>' : ':';
    return day + ". " + meseci[mon] + " " + yr + " - " + hr + collon + min;// + ":" + sec;
}
